package com.totcy.atom.presenter.contract;

import com.totcy.atom.bean.HeWeatherDailyForecast;
import com.totcy.atom.bean.HeWeatherHourly;
import com.totcy.atom.bean.HeWeatherLifeStyle;
import com.totcy.atom.bean.HeWeatherNow;
import com.totcy.atom.bean.response.HeWeatherResponse;
import com.totcy.baselibrary.base.mvpbase.BaseModel;
import com.totcy.baselibrary.base.mvpbase.BaseView;

import java.util.List;

/**
 * description : 和风天气 contract
 *
 * @author : Totcy
 * @date : 2018/1/19 17:15
 * @update : 2018/1/19
 */

public interface WeatherContract {

    interface View extends BaseView {
        /**
         * 实时天气
         */
        void onNowWeather(HeWeatherNow weatherNow);

        /**
         * 3-7天天气预报
         */
        void on3To7Weather(List<HeWeatherDailyForecast> dailyForecasts);

        /**
         * 逐小时预报
         */
        void onHourlyWeather(List<HeWeatherHourly> weatherHourlies);

        /**
         * 生活指数
         */
        void onLifeIndex(List<HeWeatherLifeStyle> lifeStyles);

        /**
         * 这里获取数据失败
         */
        void onDataFail(int code, String message);
    }

    interface Presenter {
        /**
         * Presenter 调用 model 获取数据 获取和风天气集合数据
         * 3-7天天气预报、实况天气、逐小时预报以及生活指数
         *
         * @param location location=北京
         *                 location=beijing
         *                 location=CN101010100
         *                 location= 60.194.130.1
         *                 location=120.343,36.088
         */
        void getWeatherInfoList(String location);
    }

    interface Model extends BaseModel {
        interface DataCallback {
            /**
             * 数据获取成功  返回实体
             *
             * @param weatherResponse 天气信息
             */
            void onWeatherInfo(HeWeatherResponse weatherResponse);

            /**
             * 这里获取数据失败
             */
            void onDataNotAvailable(int code, String message);
        }

        /**
         * 从网络获取数据
         */
        void getWeatherInfoList(String location, DataCallback callback);
    }

}
